﻿using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.IO;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using NUnit.Framework;
using PS.WSSDeploy.Package.Test.Config;


namespace PS.WSSDeploy.Package.Test
{
    [TestFixture]
    public class SerializeTests
    {
        [Test]
        public void Test1()
        {
            var exists = ConfigContainer.Exists("");
            var configCntr = new ConfigContainer();
            var farm1 = CreateFarmConfig1();
            configCntr.AddConfig(false, farm1);
            var farm2 = CreateFarmConfig2();
            configCntr.AddConfig(false, farm2);
            
            //bool result = configCntr.DeleteConfig(false, farm2.Name);
            //result = configCntr.DeleteConfig(false, farm1.Name);
            var sandbox1 = CreateSandboxConfig1();
            configCntr.AddConfig(true, sandbox1);
            //result = configCntr.DeleteConfig(config3.Name);
            configCntr.Save("");
            var configCntr2 = ConfigContainer.Create("");
            var list = configCntr2.GetConfigNames(false);
       



        }

        private static Config.Config CreateFarmConfig1()
        {
            var ret = new Config.Config
                          {
                              Name = "irkut",
                              ServerName = "irkut"
                          };
            return ret;
        }

        private static Config.Config CreateFarmConfig2()
        {
            var ret = new Config.Config
            {
                Name = "rebel01",
                ServerName = "rebel01"
            };
            return ret;
        }

        private static Config.Config CreateSandboxConfig1()
        {
            var ret = new Config.Config
                          {
                              Name = "http://rebel01",
                              SandboxSiteUrl = "http://rebel01"
                          };
            return ret;
        }
    }
}
